package online.longzipeng.mywebdemo.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @Author: lzp
 * @description: 静态变量配置 @value的方式 注意：该方式可能会有未知隐患，只用于学习讨论，不建议用于生产环境
 * @Date: 2023/3/15
 */
@Component
public class MyConfig1 {

	public static String appKey;

	public static String appSecret;

	@Value("${myConfig.appKey}")
	public void setAppKey(String appKey) {
		MyConfig1.appKey = appKey;
	}

	@Value("${myConfig.appSecret}")
	public void setAppSecret(String appSecret) {
		MyConfig1.appSecret = appSecret;
	}
}
